const { Router } = require('express')
const multer = require('multer')
const { uploadImage, pageImages, deleteImage } = require('../controllers/imageController')

const router = Router()
const upload = multer({ storage: multer.memoryStorage() })

router.post('/image', upload.single('file'), uploadImage)
router.get('/image', pageImages)
router.delete('/image/:id', deleteImage)

module.exports = router
